import urllib2

def get_img():
    try:
        data=urllib2.urlopen('http://www.baidu.com/img/baidu_sylogo1.gif').read()
    except:
        data=''

    f=open('d:/d.gif','wb')
    f.write(data)
    f.close()
    return data



if __name__=='__main__':
    get_img()
